package com.suray.system.run.rgv;

import com.suray.system.run.data.RgvInformation;
import com.suray.system.run.data.mysql.analyze.MonitorDataStore;
import com.suray.system.run.util.ExecTaskTime;
import com.suray.wcs.service.pojo.Rgv;
import com.suray.wcs.service.util.WcsUtil;

/**
 * 小车监控
 *
 * @author minjie
 * @since 2021-10-23 13:26:32
 */
public class RgvMonitor {

    /**
     * 小车对象
     */
    private Rgv rgv;

    /**
     * 小车监控信息
     */
    private RgvInformation rgvInformation;

    private RgvMonitorAction rgvMonitorAction;

    public RgvMonitor(Rgv rgv, RgvInformation rgvInformation, MonitorDataStore monitorDataStore) {
        this.rgv = rgv;
        this.rgvInformation = rgvInformation;

        rgvMonitorAction = new RgvMonitorAction(rgv, rgvInformation, monitorDataStore);
    }

    public void init() {
        rgvMonitorAction.init();
    }

    public void run() {
        try {
            rgvMonitorAction.run();
        } catch (Exception e) {
            WcsUtil.exceptionLog(e, this.getClass());
        }
    }

    public String getRgvName() {
        return rgv.getRgvName();
    }
}
